#include <pd_gpio.h>
#include <hd_led.h>
#include <hd_key.h>
#include "main.h"

extern void SystemClock_Config(void);

int main(void) {
    SystemClock_Config();

    uint8_t keyNum;

    GPIO *ledGPIO = GPIOBuilder.build(GPIOB, LL_GPIO_PIN_2);
    LED *led = LEDBuilder.build(ledGPIO);
    led->init(led);

    GPIO *keyGPIO = GPIOBuilder.build(GPIOA, LL_GPIO_PIN_0);
    keyGPIO->Pull = LL_GPIO_PULL_DOWN;
    Key *key = KeyBuilder.build(keyGPIO);
    key->init(key);

    while (1) {
        keyNum = key->getKeyNum(key);
        if (keyNum == 1) {
            led->turn(led);
        }
    }

}

